package com.jrzh.mvc.convert.sys;

import com.jrzh.framework.base.convert.BaseConvertI;
import com.jrzh.common.exception.ProjectException;
import com.jrzh.mvc.model.sys.MobileSmsSendingModel;
import com.jrzh.mvc.view.sys.MobileSmsSendingView;
import com.jrzh.common.utils.ReflectUtils;

public class MobileSmsSendingConvert implements BaseConvertI<MobileSmsSendingModel, MobileSmsSendingView> {

	@Override
	public MobileSmsSendingModel addConvert(MobileSmsSendingView view) throws ProjectException {
		MobileSmsSendingModel model = new MobileSmsSendingModel();
		ReflectUtils.copySameFieldToTarget(view, model);
		return model;
	}

	@Override
	public MobileSmsSendingModel editConvert(MobileSmsSendingView view, MobileSmsSendingModel model) throws ProjectException {
		ReflectUtils.copySameFieldToTargetFilter(view, model, new String[]{"createBy", "createTime"});
		return model;
	}

	@Override
	public MobileSmsSendingView convertToView(MobileSmsSendingModel model) throws ProjectException {
		MobileSmsSendingView view = new MobileSmsSendingView();
		ReflectUtils.copySameFieldToTarget(model, view);
		return view;
	}

}
